{smcl}
{* *! version 1.01  26Sep2023}{...}
{cmd:help get_doi}

{hline}

{title:Get DOI from String}

{p2colset 5 16 16 2}{...}
{p2col:{hi: get_doi} {hline 2}}Extract a Digital Object Identifier (DOI) from a given string using regular expressions.{p_end}
{p2colreset}{...}


{marker syntax}{...}
{title:Syntax}

{p 8 14 2}
{cmd:. get_doi string [, {cmdab:nod:isplay}]}

{p 8 14 2}

{synoptset 14}{...}
{synopthdr:Options}
{synoptline}
{synopt:{cmdab:nod:isplay}}
Suppress displaying the extracted DOI.
{p_end}
{synoptline}


{marker description}{...}
{title:Description}

{pstd}
{bf:get_doi} is a Stata program that extracts a Digital Object Identifier (DOI) from a given string using a regular expression. It can be useful for retrieving DOIs from text data.


{title:Examples}

{pstd}Extract a DOI from a string and store it in a local macro{p_end}

{phang2}. {stata `"get_doi "Zhu, Y., 2023, FRL, ... doi.org/10.1016/j.frl.2023.103973""'}{p_end}
{phang2}10.1016/j.frl.2023.103973{p_end}

{pstd}Store the extracted DOI in a local macro and suppress display{p_end}

{phang2}. {stata `"get_doi doi.org/10.1016/j.frl.2023.103973, nodis"'}{p_end}
{phang2}. {stata `"ret list"'}{p_end}

{pstd}Check whether the specified DOI is valid and capture the result{p_end}

{phang2}. {stata `"capture noi get_doi doi.org/10-1016/j.frl.2023.103973"'}{p_end}
{phang2}Can not find valid {DOI}, please check.{p_end}

{pstd}Check the validity of a DOI and capture the result, then perform actions based on the return value {cmd:r(valid)}.{p_end}

{phang2}
. capture get_doi "10. 10-16/j.frl.2023.103973"{p_end}


{title:Author}

{phang}
{cmd:Yujun, Lian} Lingnan College, Sun Yat-Sen University, China.{break}
E-mail: {browse "mailto:arlionn@163.com":arlionn@163.com}. {break}
Blog: {browse "https://www.lianxh.cn":lianxh.cn} {break}
{p_end}


{title:For problems and suggestions}

{p 4 4 2}
Any problems or suggestions are welcome, please Email to
{browse "mailto:arlionn@163.com":arlionn@163.com}. 

{p 4 4 2}
The project home page: {browse "https://gitee.com/arlionn/getref":https://gitee.com/arlionn/getref}


{title:Also see}

{psee} 
Online:  
{help getref} (if installed),  
{help lianxh} (if installed)
